import javax.swing.plaf.synth.SynthRadioButtonMenuItemUI;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Jiang Jinxi
 * Date: 2024-08-28
 * Time: 19:59
 */
public class Demo9 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            Thread thread2 = Thread.currentThread();
            for (int i = 0; i < 3; i++) {
                System.out.println("hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            System.out.println("thread end");
        });
        thread.start();
        thread.join(1000);
        System.out.println("main end");
    }
}
